//Tracker.vn  
//CopyRight By Tracker Group
 using System;
 using System.Text;
using System.Data;

namespace tracker.Models.DTO
{
   public class EDevice
   {
       public EDevice()
       {
       }

       private int _DeviceID;
       private string _DeviceKey;
       private int _DeviceTypeID;
       private string _DeviceKindKey;
       private string _DeviceName;
       private DateTime _CreateDate;
       private DateTime _ModifyDate;
       private string _CreateBy;
       private string _ModifyBy;
       private string _Password;
       private string _SimNumber;
       private string _PictureOfDevide;
       private bool _Status;
       private int _UserID;
       private string _Note;
       private string _DeviceKeySecurity;

       public string DeviceKeySecurity
       {
           get { return _DeviceKeySecurity; }
           set { _DeviceKeySecurity = value; }
       }
       public int DeviceID
       {
           get { return _DeviceID; }
           set { _DeviceID = value; }
       }
       public string DeviceKey
       {
           get { return _DeviceKey; }
           set { _DeviceKey = value; }
       }
       public int DeviceTypeID
       {
           get { return _DeviceTypeID; }
           set { _DeviceTypeID = value; }
       }
       public string DeviceKindKey
       {
           get { return _DeviceKindKey; }
           set { _DeviceKindKey = value; }
       }
       public string DeviceName
       {
           get { return _DeviceName; }
           set { _DeviceName = value; }
       }
       public DateTime CreateDate
       {
           get { return _CreateDate; }
           set { _CreateDate = value; }
       }
       public DateTime ModifyDate
       {
           get { return _ModifyDate; }
           set { _ModifyDate = value; }
       }
       public string CreateBy
       {
           get { return _CreateBy; }
           set { _CreateBy = value; }
       }
       public string ModifyBy
       {
           get { return _ModifyBy; }
           set { _ModifyBy = value; }
       }
       public string Password
       {
           get { return _Password; }
           set { _Password = value; }
       }
       public string SimNumber
       {
           get { return _SimNumber; }
           set { _SimNumber = value; }
       }
       public string PictureOfDevide
       {
           get { return _PictureOfDevide; }
           set { _PictureOfDevide = value; }
       }
       public bool Status
       {
           get { return _Status; }
           set { _Status = value; }
       }
       public int UserID
       {
           get { return _UserID; }
           set { _UserID = value; }
       }
       public string Note
       {
           get { return _Note; }
           set { _Note = value; }
       }
       public static EDevice createDevice(DataRow idr)
       {
           EDevice ODevice = new EDevice();
           if (idr["DeviceID"] != DBNull.Value)
               ODevice.DeviceID = (int)idr["DeviceID"];
           if (idr["DeviceKey"] != DBNull.Value)
               ODevice.DeviceKey = (string)idr["DeviceKey"];
           if (idr["DeviceTypeID"] != DBNull.Value)
               ODevice.DeviceTypeID = (int)idr["DeviceTypeID"];
           if (idr["DeviceName"] != DBNull.Value)
               ODevice.DeviceName = (string)idr["DeviceName"];
           if (idr["CreateDate"] != DBNull.Value)
               ODevice.CreateDate = (DateTime)idr["CreateDate"];
           if (idr["ModifyDate"] != DBNull.Value)
               ODevice.ModifyDate = (DateTime)idr["ModifyDate"];
           if (idr["CreateBy"] != DBNull.Value)
               ODevice.CreateBy = (string)idr["CreateBy"];
           if (idr["ModifyBy"] != DBNull.Value)
               ODevice.ModifyBy = (string)idr["ModifyBy"];
           if (idr["Password"] != DBNull.Value)
               ODevice.Password = (string)idr["Password"];
           //ODevice.Password = GPS.Library.GPSSecurity.DeCrypt(ODevice.Password, "w3s");
           if (idr["SimNumber"] != DBNull.Value)
               ODevice.SimNumber = (string)idr["SimNumber"];
           if (idr["PictureOfDevide"] != DBNull.Value)
               ODevice.PictureOfDevide = (string)idr["PictureOfDevide"];
           if (idr["Status"] != DBNull.Value)
               ODevice.Status = (bool)idr["Status"];
           if (idr["UserID"] != DBNull.Value)
               ODevice.UserID = (int)idr["UserID"];
           if (idr["Note"] != DBNull.Value)
               ODevice.Note = (string)idr["Note"];
           if (idr["DeviceKeySecurity"] != DBNull.Value)
               ODevice.DeviceKeySecurity = (string)idr["DeviceKeySecurity"];
           return ODevice;
       }
   }
 }
